# $Id: PKGBUILD 78239 2012-10-17 10:26:32Z allan $
# Contributor: Pierre Buard <pierre.buard@gmail.com>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Sebastien Piccand <sebcactus gmail com>
# Maintainer: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=('python-pyenchant' 'python2-pyenchant')
pkgver=1.6.5
pkgrel=2
arch=('any')
url="http://www.rfk.id.au/software/pyenchant/"
license=('LGPL')
makedepends=('setuptools' 'python-distribute' 'python2' 'enchant')
source=("http://pypi.python.org/packages/source/p/pyenchant/pyenchant-${pkgver}.tar.gz")
md5sums=('565014a14a52fb0195d152dd492ea948')

build() {
  cp -r pyenchant-${pkgver} pyenchant2-${pkgver}

  cd ${srcdir}/pyenchant-${pkgver}

  python3 setup.py build

  cd ${srcdir}/pyenchant2-${pkgver}

  python2 setup.py build
}

package_python-pyenchant() {
  pkgdesc="PyEnchant is a spellchecking library for Python3 based on the Enchant library"
  depends=('python' 'enchant')

  cd pyenchant-${pkgver}
  
  python3 setup.py install --root=${pkgdir} --optimize=1
}

package_python2-pyenchant() {
  pkgdesc="PyEnchant is a spellchecking library for Python2 based on the Enchant library"
  depends=('python2' 'enchant')

  cd pyenchant2-${pkgver}
  
  python2 setup.py install --root=${pkgdir} --optimize=1
}
